<template>
	<view class="page-box">
		<view class="item-box" v-for="(item,index) in listData" :key='index' @click="goPage(item.path)">
			<view class="title-box">
				{{item.title}}
			</view>
			<u-icon name="arrow-right" color="#C8C8C8" size="28"></u-icon>
		</view>
		<!-- <view class="line-box">

		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				listData: []
			}
		},
		onShow() {
			this.getPaymentCodeType()
		},
		methods: {
			getPaymentCodeType() {
				let params = {};
				let self = this
				self.$https(
					'mine.getPayPwdStatus', {
						data: params
					},
					'加载中...'
				).then(res => {
					if (res.code === 1) {
						if (res.data.status == 1) {
							// 已设置
							this.listData = [{
								title: '修改支付密码',
								path: 'pages/index/editPaymentCode'
							},
                {
								title: '忘记支付密码',
								path: 'pages/index/forgetPaymentCode'
							}
							]
						} else {
							// 未设置
							this.listData = [{
								title: '支付密码',
								path: 'pages/index/paymentCode'
							},
                {
								title: '忘记支付密码',
								path: 'pages/index/forgetPaymentCode'
							}
							]
						}
					} else {}
				});
			},
			goPage(path) {
				uni.navigateTo({
					url: path
				});
			}
		}
	}
</script>

<style scoped>
	.page-box {
		width: 100%;
		height: 100vh;
	}

	.item-box {
		width: 100%;
		height: 108rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0rpx 30rpx 0rpx 24rpx;
		background: #FFFFFF;
		border-bottom: 2rpx solid #F8F8F8;
	}

	.title-box {
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #42494F;
	}

	.line-box {
		width: 90%;
		height: 2rpx;
		margin-left: 5%;
		background: #F8F8F8;
	}
</style>
